package com.yshkj.payment.dto;

import com.yshkj.payment.entity.Privilege;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户账号权限菜单
 * Created by 唐旭 on 2016/9/28.
 */
public class AccountMenuListJsonDto extends JsonBaseDto {

    private List<AccountMenuItemDto> list = new ArrayList<>();

    public AccountMenuListJsonDto() {
    }

    public AccountMenuListJsonDto(boolean state) {
        super(state);
    }

    public AccountMenuListJsonDto(List<Privilege> privilegeTree) {
        this(true);
        for (Privilege privilege : privilegeTree) {
            list.add(new AccountMenuItemDto(privilege));
        }
    }

    public List<AccountMenuItemDto> getList() {
        return list;
    }

    public AccountMenuListJsonDto setList(List<AccountMenuItemDto> list) {
        this.list = list;
        return this;
    }
}
